import requests
from bs4 import BeautifulSoup

def retrieve_information_from_Baidu_Baike(url):
    response = requests.get(url)
    print('--------------------------------------------------------------------------\n\n')
    print(response.content)
    soup = BeautifulSoup(response.content, 'html.parser')
    # 1.爬取页面所有数据
    text = soup.get_text()

    # 4.保存文本
    with open('baidu_baike.txt', 'w', encoding='utf-8') as file:
        file.write(text)


retrieve_information_from_Baidu_Baike('https://news.cctv.cn/2025/03/31/ARTI5uul3yfPVTN0VXk21V3v250331.shtml?spm=C94212.P4YnMod9m2uD.ENPMkWvfnaiV.4')